class LineItem < ActiveRecord::Base
  belongs_to                :invoice
  validates_presence_of     :quantity
  validates_presence_of     :invoice
  validates_presence_of     :product_description
  validates_presence_of     :unit_cost
  validates_numericality_of :unit_cost
  validates_presence_of     :options_cost
  validates_numericality_of :options_cost
  
  def cost
    return ((self.unit_cost * self.quantity) + self.options_cost)
  end
end
